#include <iostream>

using namespace std;

typedef unsigned long long BIG;

int main()
{
    BIG result = 0, fib = 1, t0 = 0, t1 = 1;

    while(fib < 4000000)
    {
        if(fib%2 == 0) result += fib;
        t0 = t1;
        t1 = fib;
        fib = t0 + t1;
	}

   cout << result << endl;

   return 0;
}
